package com.java8feature.java8action.chapter3.intconsumer;

import com.test.stream.User;

import java.util.function.Supplier;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/6/10 9:38
 */
public class IntConsumerTest<T> {

    int i = 6;
    T user;
    public T testIntConsumer(IntConsumer<T> consumer) {
        return consumer.intConsumer(user);
    }

    public static void main(String[] args) {
        IntConsumerTest<User> test = new IntConsumerTest();
        User usr = new User();
      //  System.out.println(test.testIntConsumer(User::getId));

//        IntConsumer consumer = User :: new;
//        User u = consumer.intConsumer(User::new);

        Supplier<User> supplier  = User::new;
        User user111 = supplier.get();

        usr.setId(1);

        new Thread(new Runnable() {
            @Override
            public void run() {
                //System.out.println(usr.getId());
            }
        }).start();

        User user = new User();
        user.setId(2);
        usr = user;
    }
}
